package extend.函数式接口;

import java.util.Comparator;
import java.util.function.Consumer;

@FunctionalInterface
public interface MyFunction {
    void test();
}

interface MyFunction2 {
    public int get(int a, int b);

    public default void test() {
    }

//    Consumer
//    Comparator
}

//用于lambda表达式使用
class TestLambda {
    public static void main(String[] args) {
        MyFunction myFunction = () -> System.out.println("test");
        MyFunction myFunction1 = () -> System.out.println("test");
        myFunction.test();
        myFunction1.test();
        MyFunction2 myFunction2 = (a, b) -> a + b;

        System.out.println(myFunction2.get(1, 2));
    }
}